//
//  FBUserInfoModel.swift
//  FlameB
//
//  Created by 连俊 on 2020/8/3.
//  Copyright © 2020 连俊. All rights reserved.
//

import UIKit

class CartShoppingModel: NSObject, NSCopying {
    var skuId: String = ""       //skuid
    var skuCode: String = ""     //sku 编码
    var skuStatus: Int = 1       //sku状态 2为无效 1为有效
    var skuName: String = ""     //规格名称
    var productName: String = "" //产品名称
    var productId: Int = 0
    var marketPrice: Int = 0     //市场价格
    var addPrice: Int = 0        //加入购物车的价格
    var price: Int = 0           //现在价格
    var coverUrl: String = ""    //封面图片
    var num: Int = 1             //sku数量
    var stock: Int = 999
    var isSelected: Bool = false
    var lastAddTime: String = ""
    var brandId: Int = 0
    var brandName: String = ""
    var brandLogoUrl: String = ""
    ///众筹添加
    var skuRemark: String = ""  ///众筹档位描述
    var deliveryTime: Int = 0   ///众筹发货剩余天数
    var personLimit: Int = 0    ///限购数 0=不限购
    var productType: Int = 0
    var deliveryAfterDay: Int = 0
    
    func copy(with zone: NSZone? = nil) -> Any{
        let shopping = CartShoppingModel()
        shopping.skuId = self.skuId
        shopping.skuCode = self.skuCode
        shopping.skuStatus = self.skuStatus
        shopping.skuName = self.skuName
        shopping.productName = self.productName
        shopping.productId = self.productId
        shopping.marketPrice = self.marketPrice
        shopping.addPrice = self.addPrice
        shopping.price = self.price
        shopping.coverUrl = self.coverUrl
        shopping.num = self.num
        shopping.stock = self.stock
        shopping.isSelected = self.isSelected
        shopping.lastAddTime = self.lastAddTime
        shopping.brandId = self.brandId
        shopping.brandName = self.brandName
        shopping.brandLogoUrl = self.brandLogoUrl
        shopping.skuRemark = self.skuRemark
        shopping.deliveryTime = self.deliveryTime
        shopping.personLimit = self.personLimit
        shopping.productType = self.productType
        shopping.deliveryAfterDay = self.deliveryAfterDay
        return shopping
    }
}

class StoreIMBrand: NSObject {
    var brandId: Int = 0
    var brandName: String = ""
    var brandLogoUrl: String = ""
    var unreadMsgCount: Int = 0
    var lastMsgTime: String = ""
    var lastMsg: String = ""
    var totalTime: Int = 0
    
    func copy(with zone: NSZone? = nil) -> Any{
        let model = StoreIMBrand()
        model.brandId = self.brandId
        model.brandName = self.brandName
        model.brandLogoUrl = self.brandLogoUrl
        model.unreadMsgCount = self.unreadMsgCount
        model.lastMsgTime = self.lastMsgTime
        model.lastMsg = self.lastMsg
        model.totalTime = self.totalTime
        return model
    }
}
